package com.coding365.service.user.rpc;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "lagou-service-user")
public interface UserFeignClient {

    //调⽤的请求路径
    @GetMapping("/oauth/token")
    ResponseEntity<OAuth2AccessToken> oauthToken(@RequestParam(value = "client_secret",required = false) String client_secret,
                                                 @RequestParam(value = "grant_type",required = false) String grant_type,
                                                 @RequestParam(value = "username",required = false) String username,
                                                 @RequestParam(value = "password",required = false) String password,
                                                 @RequestParam(value = "client_id",required = false) String client_id);

    @GetMapping("/oauth/check_token")
    Map<String, ?> checkToken(@RequestParam(value = "token") String token);
}
